#pragma once
#include "cJSON.h"

struct dev_cdt {
	virtual int get_all_devstatus(cJSON *status) = 0;
	virtual int get_status_byaddr(const char *addr, cJSON **status) = 0;
	virtual int get_status_byarea(const char *addr, cJSON *status) = 0;
	virtual int get_status_bysaio(const char *addr, cJSON *status) = 0;

	virtual int set_property_byaddr(const char *addr, const cJSON *params) = 0;
	virtual int set_property_byarea(const char *area, const cJSON *params) = 0;
	virtual int set_property_bysaio(const char *saio, const cJSON *params) = 0;

	virtual int get_all_dev(cJSON *devs) = 0;
	virtual int get_dev_byaddr(const char *addr, cJSON **dev) = 0;
	virtual int get_dev_byarea(const char *area, cJSON *devs) = 0;
	virtual int get_dev_bysaio(const char *saio, cJSON *devs) = 0;

	virtual int cloud_online_event() = 0;
	virtual int cloud_offline_event() = 0;

	virtual int subdev_login_replay(const cJSON *devs) = 0;
	virtual int topo_get_replay(const cJSON *devs) = 0;
	virtual int topo_add_replay(const cJSON *devs) = 0;
	virtual int topo_change_notify(const cJSON *params) = 0;
	virtual int sub_register_replay(const cJSON *devs) = 0;

	virtual int analysis_scan_online_result(const cJSON *devs) = 0;
	virtual int analysis_scan_offline_result(const cJSON *devs) = 0;
	virtual int set_dev_area(const cJSON *params) = 0;
	virtual int set_dev_scenario(const cJSON *params) = 0;
	virtual int property_post_replay(const cJSON *params) = 0;

	virtual void start() = 0;
	virtual cJSON *to_json() = 0;
};